home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00185_Soda Gun Popup.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  1.1 KB  |  55 lines

  1. property pSpr, pOrigSprite, pSodaMenu
  2. global gSodaIngredientsList
  3.  
  4. on beginSprite me
  5.   pSpr = sprite(me.spriteNum)
  6.   mHidePopup(me)
  7.   pSodaMenu = EMPTY
  8.   repeat with X = 1 to count(gSodaIngredientsList)
  9.     put getname(getPropAt(gSodaIngredientsList, X)) && "(" & gSodaIngredientsList[X][#key] & ")" & RETURN after pSodaMenu
  10.   end repeat
  11.   delete char -30000 of pSodaMenu
  12.   customFont(pSpr.member)
  13. end
  14.  
  15. on mShowPopup me, origSprite
  16.   pOrigSprite = origSprite
  17.   pSpr.locH = the mouseH
  18.   pSpr.locV = min(the mouseV, (the stage).rect.height - pSpr.member.height - 15)
  19.   pSpr.loc = pSpr.loc - 10
  20.   pSpr.member.text = pSodaMenu
  21. end
  22.  
  23. on rightMouseDown me
  24.   if the stage = the activeWindow then
  25.     mouseDown(me)
  26.   end if
  27. end
  28.  
  29. on mouseDown me
  30.   thisLine = the mouseLine
  31.   if thisLine > 0 then
  32.     newIngredient = getPropAt(gSodaIngredientsList, thisLine)
  33.     sendSprite(pOrigSprite, #mChangeSoda, newIngredient)
  34.   end if
  35.   mHidePopup(me)
  36. end
  37.  
  38. on mouseWithin me
  39.   thisLine = the mouseLine
  40.   if thisLine > 0 then
  41.     hilite line thisLine of field the member of pSpr
  42.   end if
  43. end
  44.  
  45. on mouseLeave me
  46.   mHidePopup(me)
  47. end
  48.  
  49. on mHidePopup me
  50.   pSpr.locH = 1000
  51. end
  52.  
  53. on endSprite
  54. end
  55.